<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>cppMISC: include/str_template.h 源文件</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<script type="text/javascript" src="../../clipboard.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../cookie.js"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/javascript" src="../../darkmode_toggle.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">cppMISC<span id="projectnumber">&#160;v1.1</span>
   </div>
   <div id="projectbrief">cppMisc 文档系统</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(1); });
/* @license-end */
</script>
<script type="text/javascript" src="../../menudata.js"></script>
<script type="text/javascript" src="../../menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('../../',true,false,'search.php','搜索',false);
  $(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){ initResizable(false); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">载入中...</div>
<div class="SRStatus" id="Searching">搜索中...</div>
<div class="SRStatus" id="NoMatches">未找到</div>
</div>
</div>
</div>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="../../dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li>  </ul>
</div>
</div><!-- top -->
<div id="doc-content">
<div class="header">
  <div class="headertitle"><div class="title">str_template.h</div></div>
</div><!--header-->
<div class="contents">
<a href="../../d9/d60/str__template_8h.html">浏览该文件的文档.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span> </div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno">   15</span><span class="preprocessor">#ifndef __TMP_STR_H__</span></div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno">   16</span><span class="preprocessor">#define __TMP_STR_H__</span></div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno">   17</span> </div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno">   18</span><span class="preprocessor">#include &lt;time.h&gt;</span></div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno">   19</span><span class="preprocessor">#include &lt;cstdint&gt;</span></div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno">   20</span><span class="preprocessor">#include &lt;regex&gt;</span></div>
<div class="foldopen" id="foldopen00021" data-start="{" data-end="};">
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"><a class="line" href="../../db/d6a/class_c_str_tmpt.html">   21</a></span><span class="keyword">class </span><a class="code hl_class" href="../../db/d6a/class_c_str_tmpt.html">CStrTmpt</a></div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno">   22</span>{</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno">   23</span><span class="keyword">public</span>:</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"><a class="line" href="../../db/d6a/class_c_str_tmpt.html#a7a095ff8f5442bad700ee993aa6320d1">   24</a></span>    <a class="code hl_function" href="../../db/d6a/class_c_str_tmpt.html#a7a095ff8f5442bad700ee993aa6320d1">CStrTmpt</a>() = <span class="keyword">delete</span>;</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"><a class="line" href="../../db/d6a/class_c_str_tmpt.html#a024766a507aad0c454f8af07d21c0193">   25</a></span>    <a class="code hl_function" href="../../db/d6a/class_c_str_tmpt.html#a024766a507aad0c454f8af07d21c0193">CStrTmpt</a>( <span class="keyword">const</span> std::string&amp; str ) = <span class="keyword">delete</span>;</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"><a class="line" href="../../db/d6a/class_c_str_tmpt.html#ab1a865294f3a04df0d77b86aa695d573">   26</a></span>    <a class="code hl_function" href="../../db/d6a/class_c_str_tmpt.html#ab1a865294f3a04df0d77b86aa695d573">~CStrTmpt</a>() = <span class="keyword">delete</span>;</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno">   32</span>    <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="../../db/d6a/class_c_str_tmpt.html#a8ad20a7f643b9a703374eaf877112fce">isFloat</a>( <span class="keyword">const</span> std::string&amp; str );</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno">   38</span>    <span class="keyword">static</span> <span class="keywordtype">float</span> <a class="code hl_function" href="../../db/d6a/class_c_str_tmpt.html#ace6d067c0eaff8fa8b7e89ad0dad90a9">toFloat</a>( <span class="keyword">const</span> std::string&amp; str );</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno">   39</span> </div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno">   40</span>    <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="../../db/d6a/class_c_str_tmpt.html#a7c84c3062827cf899722e5b1bda30cbf">isReal</a>( <span class="keyword">const</span> std::string&amp; str );</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno">   41</span>    <span class="keyword">static</span> <span class="keywordtype">double</span> <a class="code hl_function" href="../../db/d6a/class_c_str_tmpt.html#a90d17445c4f65a09d711f680deb93d13">toReal</a>( <span class="keyword">const</span> std::string&amp; str );</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno">   42</span> </div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno">   43</span>    <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="../../db/d6a/class_c_str_tmpt.html#a815f5956a400c54e8255b1e63f3cc684">isDigit</a>( <span class="keyword">const</span> std::string&amp; str );</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno">   44</span>    <span class="keyword">static</span> <span class="keywordtype">long</span> <a class="code hl_function" href="../../db/d6a/class_c_str_tmpt.html#a2ffb47f18577d7ab069fa5d37f1164c7">toDigit</a>( <span class="keyword">const</span> std::string&amp; str );</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno">   45</span> </div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno">   46</span>    <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="../../db/d6a/class_c_str_tmpt.html#a3493833b3c80438b17075fc28f4cf00b">isHex</a>( <span class="keyword">const</span> std::string&amp; str );</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno">   47</span>    <span class="keyword">static</span> uint32_t <a class="code hl_function" href="../../db/d6a/class_c_str_tmpt.html#a1f50144c01483e18d9a756a5d59f0dc0">toHex</a>( <span class="keyword">const</span> std::string&amp; str );</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno">   48</span> </div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno">   49</span>    <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="../../db/d6a/class_c_str_tmpt.html#a3a308e17812387fc68f9d363632a8846">isDate</a>( <span class="keyword">const</span> std::string&amp; str );</div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno">   50</span>    <span class="keyword">static</span> time_t <a class="code hl_function" href="../../db/d6a/class_c_str_tmpt.html#aa07c6d2e835aa5aff47ab69a0ad62a0c">toDate</a>( <span class="keyword">const</span> std::string&amp; str );</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno">   51</span> </div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno">   52</span>    <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="../../db/d6a/class_c_str_tmpt.html#a5e6088976e333b3d4514a44a024bee78">isTime</a>( <span class="keyword">const</span> std::string&amp; str );</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno">   53</span>    <span class="keyword">static</span> time_t <a class="code hl_function" href="../../db/d6a/class_c_str_tmpt.html#a39dcbde550235cc027efa0011f6a6e3b">toTime</a>( <span class="keyword">const</span> std::string&amp; str );</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno">   54</span> </div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno">   55</span>    <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="../../db/d6a/class_c_str_tmpt.html#a6f036c6f23c6da918e54117fb5bc9158">isDateTime</a>( <span class="keyword">const</span> std::string&amp; str );</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno">   56</span>    <span class="keyword">static</span> time_t <a class="code hl_function" href="../../db/d6a/class_c_str_tmpt.html#a6cf0c37c4ea869e3bd0ded260e06ccd1">toDateTime</a>( <span class="keyword">const</span> std::string&amp; str );</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno">   57</span>};</div>
</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno">   58</span><span class="preprocessor">#endif</span></div>
<div class="ttc" id="aclass_c_str_tmpt_html"><div class="ttname"><a href="../../db/d6a/class_c_str_tmpt.html">CStrTmpt</a></div><div class="ttdoc">字符串模式匹配类 字符串中没有提供对特殊格式的字符串的匹配功能。在LTRP中经常需要对特定字符串的格式进行判断或者内容提取，如对浮点的判断，对IP地址的判断 对Email地址的判断甚至对物料命名的格式进...</div><div class="ttdef"><b>定义</b> <a href="#l00021">str_template.h:22</a></div></div>
<div class="ttc" id="aclass_c_str_tmpt_html_a024766a507aad0c454f8af07d21c0193"><div class="ttname"><a href="../../db/d6a/class_c_str_tmpt.html#a024766a507aad0c454f8af07d21c0193">CStrTmpt::CStrTmpt</a></div><div class="ttdeci">CStrTmpt(const std::string &amp;str)=delete</div></div>
<div class="ttc" id="aclass_c_str_tmpt_html_a1f50144c01483e18d9a756a5d59f0dc0"><div class="ttname"><a href="../../db/d6a/class_c_str_tmpt.html#a1f50144c01483e18d9a756a5d59f0dc0">CStrTmpt::toHex</a></div><div class="ttdeci">static uint32_t toHex(const std::string &amp;str)</div><div class="ttdef"><b>定义</b> <a href="../../db/ddf/str__template_8cpp_source.html#l00082">str_template.cpp:82</a></div></div>
<div class="ttc" id="aclass_c_str_tmpt_html_a2ffb47f18577d7ab069fa5d37f1164c7"><div class="ttname"><a href="../../db/d6a/class_c_str_tmpt.html#a2ffb47f18577d7ab069fa5d37f1164c7">CStrTmpt::toDigit</a></div><div class="ttdeci">static long toDigit(const std::string &amp;str)</div><div class="ttdef"><b>定义</b> <a href="../../db/ddf/str__template_8cpp_source.html#l00057">str_template.cpp:57</a></div></div>
<div class="ttc" id="aclass_c_str_tmpt_html_a3493833b3c80438b17075fc28f4cf00b"><div class="ttname"><a href="../../db/d6a/class_c_str_tmpt.html#a3493833b3c80438b17075fc28f4cf00b">CStrTmpt::isHex</a></div><div class="ttdeci">static bool isHex(const std::string &amp;str)</div><div class="ttdef"><b>定义</b> <a href="../../db/ddf/str__template_8cpp_source.html#l00072">str_template.cpp:72</a></div></div>
<div class="ttc" id="aclass_c_str_tmpt_html_a39dcbde550235cc027efa0011f6a6e3b"><div class="ttname"><a href="../../db/d6a/class_c_str_tmpt.html#a39dcbde550235cc027efa0011f6a6e3b">CStrTmpt::toTime</a></div><div class="ttdeci">static time_t toTime(const std::string &amp;str)</div><div class="ttdef"><b>定义</b> <a href="../../db/ddf/str__template_8cpp_source.html#l00131">str_template.cpp:131</a></div></div>
<div class="ttc" id="aclass_c_str_tmpt_html_a3a308e17812387fc68f9d363632a8846"><div class="ttname"><a href="../../db/d6a/class_c_str_tmpt.html#a3a308e17812387fc68f9d363632a8846">CStrTmpt::isDate</a></div><div class="ttdeci">static bool isDate(const std::string &amp;str)</div><div class="ttdef"><b>定义</b> <a href="../../db/ddf/str__template_8cpp_source.html#l00104">str_template.cpp:104</a></div></div>
<div class="ttc" id="aclass_c_str_tmpt_html_a5e6088976e333b3d4514a44a024bee78"><div class="ttname"><a href="../../db/d6a/class_c_str_tmpt.html#a5e6088976e333b3d4514a44a024bee78">CStrTmpt::isTime</a></div><div class="ttdeci">static bool isTime(const std::string &amp;str)</div><div class="ttdef"><b>定义</b> <a href="../../db/ddf/str__template_8cpp_source.html#l00125">str_template.cpp:125</a></div></div>
<div class="ttc" id="aclass_c_str_tmpt_html_a6cf0c37c4ea869e3bd0ded260e06ccd1"><div class="ttname"><a href="../../db/d6a/class_c_str_tmpt.html#a6cf0c37c4ea869e3bd0ded260e06ccd1">CStrTmpt::toDateTime</a></div><div class="ttdeci">static time_t toDateTime(const std::string &amp;str)</div><div class="ttdef"><b>定义</b> <a href="../../db/ddf/str__template_8cpp_source.html#l00144">str_template.cpp:144</a></div></div>
<div class="ttc" id="aclass_c_str_tmpt_html_a6f036c6f23c6da918e54117fb5bc9158"><div class="ttname"><a href="../../db/d6a/class_c_str_tmpt.html#a6f036c6f23c6da918e54117fb5bc9158">CStrTmpt::isDateTime</a></div><div class="ttdeci">static bool isDateTime(const std::string &amp;str)</div><div class="ttdef"><b>定义</b> <a href="../../db/ddf/str__template_8cpp_source.html#l00138">str_template.cpp:138</a></div></div>
<div class="ttc" id="aclass_c_str_tmpt_html_a7a095ff8f5442bad700ee993aa6320d1"><div class="ttname"><a href="../../db/d6a/class_c_str_tmpt.html#a7a095ff8f5442bad700ee993aa6320d1">CStrTmpt::CStrTmpt</a></div><div class="ttdeci">CStrTmpt()=delete</div></div>
<div class="ttc" id="aclass_c_str_tmpt_html_a7c84c3062827cf899722e5b1bda30cbf"><div class="ttname"><a href="../../db/d6a/class_c_str_tmpt.html#a7c84c3062827cf899722e5b1bda30cbf">CStrTmpt::isReal</a></div><div class="ttdeci">static bool isReal(const std::string &amp;str)</div><div class="ttdef"><b>定义</b> <a href="../../db/ddf/str__template_8cpp_source.html#l00027">str_template.cpp:27</a></div></div>
<div class="ttc" id="aclass_c_str_tmpt_html_a815f5956a400c54e8255b1e63f3cc684"><div class="ttname"><a href="../../db/d6a/class_c_str_tmpt.html#a815f5956a400c54e8255b1e63f3cc684">CStrTmpt::isDigit</a></div><div class="ttdeci">static bool isDigit(const std::string &amp;str)</div><div class="ttdef"><b>定义</b> <a href="../../db/ddf/str__template_8cpp_source.html#l00049">str_template.cpp:49</a></div></div>
<div class="ttc" id="aclass_c_str_tmpt_html_a8ad20a7f643b9a703374eaf877112fce"><div class="ttname"><a href="../../db/d6a/class_c_str_tmpt.html#a8ad20a7f643b9a703374eaf877112fce">CStrTmpt::isFloat</a></div><div class="ttdeci">static bool isFloat(const std::string &amp;str)</div><div class="ttdoc">判断是否是浮点数</div><div class="ttdef"><b>定义</b> <a href="../../db/ddf/str__template_8cpp_source.html#l00004">str_template.cpp:4</a></div></div>
<div class="ttc" id="aclass_c_str_tmpt_html_a90d17445c4f65a09d711f680deb93d13"><div class="ttname"><a href="../../db/d6a/class_c_str_tmpt.html#a90d17445c4f65a09d711f680deb93d13">CStrTmpt::toReal</a></div><div class="ttdeci">static double toReal(const std::string &amp;str)</div><div class="ttdef"><b>定义</b> <a href="../../db/ddf/str__template_8cpp_source.html#l00035">str_template.cpp:35</a></div></div>
<div class="ttc" id="aclass_c_str_tmpt_html_aa07c6d2e835aa5aff47ab69a0ad62a0c"><div class="ttname"><a href="../../db/d6a/class_c_str_tmpt.html#aa07c6d2e835aa5aff47ab69a0ad62a0c">CStrTmpt::toDate</a></div><div class="ttdeci">static time_t toDate(const std::string &amp;str)</div><div class="ttdef"><b>定义</b> <a href="../../db/ddf/str__template_8cpp_source.html#l00113">str_template.cpp:113</a></div></div>
<div class="ttc" id="aclass_c_str_tmpt_html_ab1a865294f3a04df0d77b86aa695d573"><div class="ttname"><a href="../../db/d6a/class_c_str_tmpt.html#ab1a865294f3a04df0d77b86aa695d573">CStrTmpt::~CStrTmpt</a></div><div class="ttdeci">~CStrTmpt()=delete</div></div>
<div class="ttc" id="aclass_c_str_tmpt_html_ace6d067c0eaff8fa8b7e89ad0dad90a9"><div class="ttname"><a href="../../db/d6a/class_c_str_tmpt.html#ace6d067c0eaff8fa8b7e89ad0dad90a9">CStrTmpt::toFloat</a></div><div class="ttdeci">static float toFloat(const std::string &amp;str)</div><div class="ttdoc">将字符串转换成浮点数</div><div class="ttdef"><b>定义</b> <a href="../../db/ddf/str__template_8cpp_source.html#l00013">str_template.cpp:13</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0
</small></address>
</div><!-- doc-content -->
</body>
</html>
